import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Echo App',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Echo App'),
        ),
        body: Echo(text: "Hello, World!"),
      ),
    );
  }
}

class Echo extends StatelessWidget {
  const Echo({
    Key? key,  
    required this.text,
    this.backgroundColor = Colors.grey, // 默认为灰色
  }) : super(key: key);
    
  final String text;
  final Color backgroundColor;

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Container(
        color: backgroundColor,
        child: Text(text),
      ),
    );
  }
}